package com.boot2.core.kafka;

import com.boot2.core.utils.SerializeUtil;
import org.apache.kafka.common.serialization.Deserializer;

import java.util.Map;

/**
 *
 * @ClassName: KafkaDecode
 * @Description: Kafka消息解码
 * @author zhangweilin
 * @date 2017年11月9日 下午1:30:42
 *
 */
public class KafkaDecode implements Deserializer<Object> {

	@Override
	public void configure(Map<String, ?> configs, boolean isKey) {
	}

	@Override
	public Object deserialize(String topic, byte[] data) {
//		System.out.println("KafkaDecode: " + data);
		return SerializeUtil.unserialize(data);
	}

	@Override
	public void close() {

	}
}